# Written by: Camiel Verschoor
# Date: 18 April 2011
# Description: Loads the football code if the left button is pressed

from naoqi import ALProxy
import time
import os

#Built ins loaded
speak = ALProxy("ALTextToSpeech", "127.0.0.1", 9559)
memory = ALProxy("ALMemory", "127.0.0.1", 9559)

#Instruction
speak.say("Press my left bumper in the next 10 seconds to activate football mode")
football = False
start = time.time()

while time.time() - start < 10:
    if not((memory.getData("LeftBumperPressed", 0) == 0.0)):
        football = True

# Load football code if pressed
if football:
    speak.say("Football mode activated")
    os.system("python /home/nao/naoqi/lib/soul.py")
else:
    speak.say("You can now use me")